package com.tongdainfo.common.parser;

import java.io.File;
import java.io.InputStream;

import com.aiiju.core.util.HtmlToString;

public class HtmlParser  implements IParser  {
	
	 private String[] fileTypes = {"html"};

	@Override
	public String[] getFileTypes() {
		return fileTypes;
	}

	@Override
	public String readText(File file, String charset) throws Exception {
		String readText = new TxtParser().readText(file, charset);
		String htmlToString = HtmlToString.htmlToString(readText);
		return htmlToString;
	}

	@Override
	public String readInput(InputStream input, String charset) throws Exception {
		String readText = new TxtParser().readInput(input, charset);
		String htmlToString = HtmlToString.htmlToString(readText);
		return htmlToString;
	}

}